<?php

namespace Services\Card;

use Common\Model\UserCardListModel;
use Services\BaseService;
use Services\Upload\OssFileService;

class CardService extends BaseService
{
    private $model;

    public function __construct()
    {
        $this->model = new UserCardListModel();
    }

    public function getCardInfo($userId)
    {
        $userCard = $this->model->where(['user_id' => $userId])->find();
        if ($userCard) {
            $userCard['c_weixin_img'] = OssFileService::getOssUrl($userCard['c_weixin_img']);
        }
        return $userCard ? $userCard : [];
    }
}
